package com.lst.quartz.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.dataflow.DataflowJob;
import com.lesent.model.entity.Student;

import java.util.ArrayList;
import java.util.List;

/**
 * @author shengtao
 * @Description:
 * @date 2018/12/12 17:08
 */
public class MyDataFlowJob implements DataflowJob<Student> {
    @Override
    public List<Student> fetchData(ShardingContext shardingContext) {
        List<Student> students = new ArrayList<>();


        return students;
    }

    @Override
    public void processData(ShardingContext shardingContext, List<Student> list) {
        System.out.println("执行了：：：：：：：elastic-job => dataFlow");
        for (Student user: list) {
            System.out.println(String.format("用户 %s 开始计息", user.getBirthDay()));
            /**
             * update user
             */
        }


    }
}
